﻿@model IEnumerable<SchoolManagerMVC.Web.ViewModel.DepartmentViewModel>
@{
    ViewBag.Title = "Departments";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Departments</h2>


<table>
    <tr>
        <th>
            Name
        </th>
        <th>
            Department Head
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.department.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DepartmentHeadName)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.department.DepartmentID }) |
            @Html.ActionLink("Details", "Details", new { id = item.department.DepartmentID }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.department.DepartmentID })
        </td>
    </tr>
}

</table>
<p>
    @Html.ActionLink("Create New", "Create")
</p>